package cn.jesin.chataiapplication.utils;

import com.alibaba.dashscope.aigc.generation.Generation;
import org.apache.commons.pool2.BasePooledObjectFactory;
import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.impl.DefaultPooledObject;

/**
 * @author 谷汉斌
 * @description
 * @createTime 2024/9/18 下午3:10
 */
public class PooledDashScopeObjectFactory extends BasePooledObjectFactory<Generation> {

    @Override
    public Generation create() {
        return new Generation();
    }

    @Override
    public PooledObject<Generation> wrap(Generation obj) {
        return new DefaultPooledObject<>(obj);
    }
}